package com.linkage.educloud.ah.adapter.topic;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.ViewGroup;

import com.linkage.educloud.ah.bean.LabelBean;
import com.linkage.educloud.ah.view.fragment.topic.TopicChildListFragment;

import java.util.List;

/**
 * Created by Mr'Tang on 2018/11/7.
 */

public class TopicChildViewPagerAdapter extends FragmentPagerAdapter {
    List<TopicChildListFragment> fragmentList;
    List<LabelBean> labelBeans;

    public TopicChildViewPagerAdapter(FragmentManager fm, List<TopicChildListFragment> list1, List<LabelBean> list2) {
        super(fm);
        fragmentList = list1;
        labelBeans = list2;
    }

    @Override
    public String getPageTitle(int position) {
        return labelBeans.get(position).getName();
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        return super.instantiateItem(container, position);
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }
}